package com.activiti.workflow.listener;

import lombok.extern.slf4j.Slf4j;
import org.activiti.engine.delegate.DelegateTask;
import org.activiti.engine.delegate.TaskListener;

/**
 * task Listeners中的class类型,在.bpmn中填写：${delegateExpressionTaskListener}
 */
/*
<userTask activiti:exclusive="true" id="UserTask_4" name="总经理审批">
    <extensionElements>
        <activiti:taskListener delegateExpression="${delegateExpressionTaskListener}" event="create"/>
    </extensionElements>
</userTask>
 */

@Slf4j
public class DelegateExpressionTaskListener implements TaskListener {
    @Override
    public void notify(DelegateTask delegateTask) {
        System.out.println("-------- DelegateExpressionTaskListener --------");
        delegateTask.setAssignee("王五88");
    }
}
